From: Carlos Garnacho Date: Fri, 26 Sep 2025 03:01:01 +0000 (+0200) Subject: status/remoteAccess: Port to click gestures X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~44^2~128 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f9fbd371b1e16b3e52d6782c4e2f2651719e670b;p=gnome-shell.git status/remoteAccess: Port to click gestures Part-of: --- diff --git a/js/ui/status/remoteAccess.js b/js/ui/status/remoteAccess.js index b7b70661e..99d7f9483 100644 --- a/js/ui/status/remoteAccess.js +++ b/js/ui/status/remoteAccess.js @@ -92,14 +92,12 @@ export const ScreenRecordingIndicator = GObject.registerClass({ Main.screenshotUI.connect( 'notify::screencast-in-progress', this._onScreencastInProgressChanged.bind(this)); - } - - vfunc_event(event) { - if (event.type() === Clutter.EventType.TOUCH_BEGIN || - event.type() === Clutter.EventType.BUTTON_PRESS) - Main.screenshotUI.stopScreencast(); - return Clutter.EVENT_PROPAGATE; + this._clickGesture = new Clutter.ClickGesture(); + this._clickGesture.set_recognize_on_press(true); + this._clickGesture.connect( + 'recognize', () => Main.screenshotUI.stopScreencast()); + this.add_action(this._clickGesture); } _updateLabel() { @@ -163,6 +161,11 @@ export const ScreenSharingIndicator = GObject.registerClass({ (o, handle) => this._onNewHandle(handle)); this._sync(); + + this._clickGesture = new Clutter.ClickGesture(); + this._clickGesture.set_recognize_on_press(true); + this._clickGesture.connect('recognize', () => this._stopSharing()); + this.add_action(this._clickGesture); } _onNewHandle(handle) { @@ -184,14 +187,6 @@ export const ScreenSharingIndicator = GObject.registerClass({ this._sync(); } - vfunc_event(event) { - if (event.type() === Clutter.EventType.TOUCH_BEGIN || - event.type() === Clutter.EventType.BUTTON_PRESS) - this._stopSharing(); - - return Clutter.EVENT_PROPAGATE; - } - _stopSharing() { for (const handle of this._handles) handle.stop();